package test;
import java.util.ArrayList;
import java.util.List;

import net.nandleon.AgenceVoyage.server.HibernateUtil;
import net.nandleon.AgenceVoyage.server.beans.User;

import org.hibernate.Session;
import org.junit.Before;
import org.junit.Test;


public class test {

	@Before
	  public void setUp() throws Exception {
		
	}
	
	
	@Test
	public void testBDD(){
		Session session = HibernateUtil.currentSession();
	    session.beginTransaction();
	    List<User> records = new ArrayList<User>(session.createQuery("from User").list());
	    session.getTransaction().commit();
	    System.out.println(records.get(0).getLogin());
	    session.close();
	}
	
}
